
#include "member.h"

Member::Member() {
    tensile_strength = 1;
    compressive_strength = 1;

    force = 0;
}

double Member::getTensileStrength() {return tensile_strength;}
void Member::setTensileStrength(double val) {tensile_strength = val;}
double Member::getCompressiveStrength() {return compressive_strength;}
void Member::setCompressiveStrength(double val) {
    compressive_strength = val;
}

double Member::getForce() {return force;}
void Member::setForce(double val) {force = val;}

Point Member::getPoint1() {return point1;}
void Member::setPoint1(Point val) {point1 = val;}

Point Member::getPoint2() {return point2;}
void Member::setPoint2(Point val) {point2 = val;}

double Member::getLength() {
    double aX, aY, bX, bY;
    aX = point1.getX();
    bX = point2.getX();
    aY = point1.getY();
    bY = point2.getY();
    return pow(pow(aX - bX, 2.0) + pow(aY - bY, 2.0), 0.5);
}

double Member::getRatio1X() {
    return (point2.getX() - point1.getX()) / getLength();
}
double Member::getRatio2X() {
    return (point1.getX() - point2.getX()) / getLength();
}
double Member::getRatio1Y() {
    return (point2.getY() - point1.getY()) / getLength();
}
double Member::getRatio2Y() {
    return (point1.getY() - point2.getY()) / getLength();
}

void Member::draw() {}

